/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
#ifndef MOCK_SECURITY_COMPONENT_SYSTEM_ABILITY_H
#define MOCK_SECURITY_COMPONENT_SYSTEM_ABILITY_H

#include <gmock/gmock.h>
#include "if_system_ability_manager.h"
#include "iremote_object.h"

namespace OHOS {
#define REGISTER_SYSTEM_ABILITY_BY_ID(abilityClassName, systemAbilityId, runOnCreate) \
    const bool abilityClassName##_##RegisterResult = \
    SystemAbility::MakeAndRegisterAbility(new abilityClassName(systemAbilityId, runOnCreate));

#define DECLEAR_SYSTEM_ABILITY(className) \
public: \
virtual std::string GetClassName() override { \
return #className; \
}

#define DECLEAR_BASE_SYSTEM_ABILITY(className) \
public: \
virtual std::string GetClassName() = 0

#define DECLARE_SYSTEM_ABILITY(className) \
public: \
virtual std::string GetClassName()  { \
return #className; \
}

#define DECLARE_BASE_SYSTEM_ABILITY(className) \
public: \
virtual std::string GetClassName() = 0

enum class SystemAbilityState {
    NOT_LOADED = 0,
    ACTIVE,
    IDLE,
};
#define SA_ID_SECURITY_COMPONENT_SERVICE 1000

class SystemAbility {
public:
    static bool MakeAndRegisterAbility(SystemAbility*)
    {
        return true;
    }

    virtual void OnStart() {};

    virtual void OnStop() {};

    MOCK_METHOD1(Publish, bool(sptr<IRemoteObject>));

    SystemAbility(bool runOnCreate = false) {};

    SystemAbility(const int32_t serviceId, bool runOnCreate = false) {};

    virtual ~SystemAbility() = default;
};
}  // namespace OHOS
#endif  // MOCK_SECURITY_COMPONENT_SYSTEM_ABILITY_H
